<!DOCTYPE html>
<html lang="zh">
<head>
	<meta charset="utf-8">
	<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">
	<title>登录后台管理系统</title>
	<meta name="description" content="#(prj)#(config.sys_name??)">
	<link href="#(prj)/assets/static/css/bootstrap.min.css" rel="stylesheet"/>
	<link href="#(prj)/assets/static/css/font-awesome.min.css" rel="stylesheet"/>
	<link href="#(prj)/assets/static/css/style.min.css" rel="stylesheet"/>
	<link href="#(prj)/assets/static/css/login.min.css" rel="stylesheet"/>
	<link href="#(prj)/assets/static/ruoyi/css/ry-ui.css" rel="stylesheet"/>
	<!-- 360浏览器急速模式 -->
	<meta name="renderer" content="webkit">
	<!-- 避免IE使用兼容模式 -->
	<meta http-equiv="X-UA-Compatible" content="IE=edge">
	<link rel="shortcut icon" href="#(prj)#(config.ico)"/>
	<style type="text/css">
		.udfsignin {
			height: auto;
			background: url('#(prj)#(config.login_bg)') no-repeat center fixed;
			-webkit-background-size: cover;
			-moz-background-size: cover;
			-o-background-size: cover;
			background-size: cover;
		}
	</style>
	<script>
/*        if (window.top !== window.self) {
            alert('未登录或登录超时。请重新登录');
            window.top.location = window.location
        }*/

	</script>
</head>
<body class="udfsignin">
<div class="signinpanel">
	<div class="row">
		<div class="col-sm-7">
			<div class="signin-info">
<!--				<div class="logopanel m-b">
					<h1><img alt="#(config.sys_name??)" width="200px" src="#(prj)#(config.logo??)"></h1>
				</div>-->
				<div class="m-b"></div>
				<h4 style="font-size: 18px">欢迎进入 <strong> 后台管理系统</strong></h4>
				<ul class="m-b">
					#for(x : config.list)
					<li><i class="fa fa-arrow-circle-o-right m-r-xs"></i>#(x)</li>
					#end
				</ul>
<!--				<strong><a href="javascript:layer.alert('请联系管理员：#(prj)#(config.mobile??)')"> 如使用中有任何问题，请及时与我们联系&raquo;</a></strong>-->
				<strong><a style="color: white" href="javascript:layer.alert('管理员信息：#(prj)#(config.mobile??)')"> ----- 如使用中有任何问题，请及时与我们联系 -----</a></strong>
			</div>
		</div>
		<div class="col-sm-5">
			<form id="sublogin">
				<h4 class="no-margins" style="font-size: 16px">账户密码登录：</h4>
				<!--<p class="m-t-md">#(config.core_idea??)</p>-->
				<input type="text" name="username" class="form-control uname" placeholder="用户名" value="#(ckusername??)"/>
				<input type="password" name="password" class="form-control pword" placeholder="密码" value="#(ckpassword??)"/>
				<div class="row m-t">
					<div class="col-xs-6">
						<input type="text" name="vercode" class="form-control code" placeholder="验证码"
							   maxlength="5"/>
					</div>
					<div class="col-xs-6">
						<a href="javascript:void(0);" title="点击更换验证码">
							<img src="#(prj)/admin/login/captcha" id="imgcode" class="imgcode" width="85%"/>
						</a>
					</div>
				</div>
				<div class="checkbox-custom">
					<input type="checkbox" id="remember" #if(ckremember) checked #end name="remember">
					<label for="remember">记住我</label>
				</div>
				<a class="btn btn-success btn-block" id="sub" data-loading="正在验证登录，请稍后...">登录</a>
			</form>
		</div>
	</div>
	<div class="signup-footer" style="margin-top: 250px">
		<div class="pull-left">
			#(prj)#(config.copyright??) <br>
		</div>
	</div>
</div>

<script src="#(prj)/assets/static/js/jquery.min.js"></script>
<script src="#(prj)/assets/static/ajax/libs/validate/jquery.validate.min.js"></script>
<script src="#(prj)/assets/static/ajax/libs/layer/layer.min.js"></script>
<script src="#(prj)/assets/static/ajax/libs/blockUI/jquery.blockUI.js"></script>
<script src="#(prj)/assets/static/ruoyi/js/ry-ui.js"></script>
<script src="#(prj)/assets/static/js/tripledes.js"></script>
<script src="#(prj)/assets/static/js/mode-ecb.js"></script>
<script src="#(prj)/assets/static/js/desUtil.js"></script>
<script src="#(prj)/assets/static/js/base.js"></script>
<script src="#(prj)/assets/static/js/jsencrypt.min.js"></script>

<script>

   /* var pubKey = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAvcm08/QoRqgxxu+BPOLce/1lCMsicZbTqbTvzvi7YwhXrFNDqSN84jjehxzBKqEbW02myQ6hf5TpjSiQLC09ugwaC/VuVW1RaR7GbXiOGTTp/L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QSFDrWDIxHp5Nre21ychVhHsvz0rQpFNkW9weAsi7NZlwvcJyRu1GZXdjND2Nc6ML1Z6Rwji8qwKyjvEUzuYrnnrmpdw3AwKBgQDVhbYhfqJunuF0oili3WGf85pz+8/NLkZPfksIhzleOe2/o4Ez+p8uRjuHbwLt66aG+uowQE2TbVgQEn1ZXy99pv2EaOUHjejOFnd0TOovz9gouPnFCgqSDB4bcGOdIz5cFgFC48DJTJhcxHxNv54bWTEuCFrObdE2FBRgx4RxgwKBgFpK6UxUU/T2ysaWMeHHmTfwdOqtJum/uSMfRKCN+N8tiO+1cEaye0b/xTu2HDNXrZIdGqv8dXfPBy0b5TBegRxIwBynBgr7FUoKFi/0nAWLD6RlZ0VpaWoQbOD2C/D5ADLNFMEC++HjnzGVBSVl4snLOnjMjBHrwB5S9wYLjwUtAoGAQ2IBCiz2gcZuC+qo+OQ4TMwJsBSFjZDO64NFlplmB1BssQ+eVJMA7Q+I9cKYwBCf6vUANt30HVRieB/9otihGhw64TBhJrMoBvGcHP2w4gnLg35shDwY/eIJFkuvhAV9Rn5DQ6KwUlZztsLjH34bHTJWjNpiHccWQOSxUaFlMJUCgYBnHLp4oXA/zw2l/QzeFcGQR0J+VF2lKyQIiHLWVZ4lpI3tFi5WjAaHP5nNbDnTwqBcnKeqwc+j4odzugTqFwDxmWvCSRuaa0K1SMUCEOdQh6InOFI5c5HW1IhRUae+c8s8T2RWy3Z+GLE3ko8A+/mqTSswlyCdKsPX3OBCjlcF7g==";

	function RSAencrypt(){
        var encrypt = new JSEncrypt();
        encrypt.setPublicKey(pubKey);
        var encrypted = encrypt.encrypt("Hello World!!!");
        console.log("加密："+encrypted)
        return encrypted;
	}

    function RSAdecrypt(crypt){
        var decrypt = new JSEncrypt();
        decrypt.setPrivateKey(priKey);
        var uncrypted = decrypt.decrypt(crypt);
        console.log("解密："+uncrypted);
	}

    RSAdecrypt(RSAencrypt());*/



    $("#sub").click(function () {
        login();
    })

    $("input[name=username],input[name=password],input[name=vercode]").keyup(function(event){
        if(event.keyCode ==13){
            login();
        }
    });


    $("#imgcode").click(function () {
        vercodeChange();
    })

    function vercodeChange() {
        $("#imgcode").attr("src","#(prj)/admin/login/captcha?t="+new Date().getTime());
    }
    //登录
    function login(){
        var username = $("input[name=username]").val();
        var password = $("input[name=password]").val();
        var vercode = $("input[name=vercode]").val();

        var remember = $("input[name='remember']").is(":checked");

        if(remember){
            remember = "on";
		}else{
            remember = "";
		}

        if(username == null || username == ''){
            $.modal.msgError("请输入用户名")
            return false;
        }
        if(password == null || password == ''){
            $.modal.msgError("请输入密码")
            return false;
        }
        if(vercode == null || vercode == ''){
            $.modal.msgError("请输入验证码")
            return false;
        }
        var eDate = new Date().getTime()+ (300 * 1000);

        $.ajax(
            {
                url: "#(prj)/admin/login/doLogin",
                type: "post",
                dataType: "json",
                //data: $('#sublogin').serialize(),
                data: {
                    "username":username,
                    "password":encryptByDES(password+"#"+eDate,"wikcnV9ysUtuJrAdvhBkaT-9"),
                    "vercode":vercode,
                    "remember": remember
                },
                beforeSend: function () {
                    $.modal.loading("正在处理中，请稍后...");
                },
                success: function(result) {
                    if (result.state == 'ok') {
                        location.href = "#(prj)/admin"
                    } else {
                        $.modal.alertError(result.msg);
                        vercodeChange();
                        $.modal.closeLoading();
                    }
                }
            }
        )
    }



</script>
</body>
</html>
